package com.xebest.web.mapper.write;

import com.xebest.web.model.XeVenOrderInfoDetailEntity;
import com.xebest.web.model.XeVenOrderInfoEntity;
import com.xebest.web.model.XeVenOrderStoreEntity;
import com.xebest.web.view.XeVenSendOrderPrintView;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 订单操作类
 *
 * @author ruancz
 */
@Repository
public interface XeVenOrderWriteMapper {


    /**
     * 新增订单
     *
     * @author ruancz
     */
    int insertXeVenOrderInfo(XeVenOrderInfoEntity venOrderInfoEntity);


    /**
     * 批量插入订单
     *
     * @author 李贝贝
     */
    int insertXeVenOrderInfoBatch(List<XeVenOrderInfoEntity> list) throws Exception;

    /**
     * 修改订单
     *
     * @author ruancz
     */
    int updateXeVenOrderInfo(XeVenOrderInfoEntity venOrderInfoEntity);

    /**
     * 新增仓库订单
     *
     * @author ruancz
     */
    int insertXeVenOrderStore(XeVenOrderStoreEntity orderStoreEntity);

    /**
     * 更新仓库订单
     *
     * @author ruancz
     */
    int updateXeVenOrderStore(XeVenOrderStoreEntity orderStoreEntity);

    /**
     * 新增订单明细
     *
     * @author ruancz
     */
    int insertXeVenOrderInfoDetail(XeVenOrderInfoDetailEntity venOrderInfoDetailEntity);

    /**
     * 更新订单明细
     *
     * @author ruancz
     */
    int updateXeVenOrderInfoDetail(XeVenOrderInfoDetailEntity XeVenOrderInfo);

    /**
     * 批量插入订单明细
     *
     * @author ruancz
     */
    int insertBatchXeVenOrderInfoDetail(List<XeVenOrderInfoDetailEntity> list);

    /**
     * 批量修改订单
     *
     * @author ruancz
     */
    int updateBatchOrderInfo(List<XeVenOrderInfoEntity> orderInfoList);

    /**
     * 批量修改订单明细
     *
     * @author ruancz
     */
    int updateBatchOrderInfoDetail(List<XeVenOrderInfoDetailEntity> orderinfoEntityList);

    /**
     * 修改实发
     *
     * @param orderId
     */
    int updateBatchOrderInfoDetailByOrderId(String orderId);

    /**
     * 条件查询订单明细信息
     *
     * @author ruancz
     */
    List<XeVenOrderInfoDetailEntity> getOrderDetailByParam(Map<String, Object> params);

    List<Map<String, Object>> queryOrderListByParams(Map<String, Object> params);

    int updateXeVenOrderInfoDetailByOrderId(XeVenOrderInfoDetailEntity venOrderInfoDetailEntity);


    XeVenOrderInfoEntity queryOrderInfo(Map<String, Object> map);

    /**
     * 根据审核波次号查询生成打印批次号所需信息
     *
     * @author 赵盼飞
     */
    List<Map<String, Object>> selectOrderByCheckBatchNum(String checkBatchNum);

    /**
     * 统计订单是否存在同步订单使用
     *
     * @author 李贝贝
     */
    BigDecimal countOrderExists(List<String> orderList);

    int updateOrderInfo(XeVenOrderInfoEntity orderInfoEntity);

    /**
     * 批量更新订单打印状态
     *
     * @author 李贝贝
     */
    int batchUpdateOrderPrintStauts(List<XeVenSendOrderPrintView> orderList);
}
